package cn.iocoder.yudao.module.xkfz.domain.entity.basic;

import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.xkfz.domain.entity.rules.RulesTypeLevel;
import cn.iocoder.yudao.module.xkfz.domain.entity.rules.RulesTypeLevelGroup;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Transient;

import java.util.List;

@Data
@TableName("INDICATOR_TREE")
//@KeySequence("indicator_tree_seq")
public class IndicatorTree extends TenantBaseDO {

//    @TableId(value = "ID", type = IdType.INPUT)
    @TableId(value = "ID")
    @Schema(description = "id")
    Long id;

    @TableField("INDICATOR_NAME")
    @Schema(description = "指标名称")
    String indicatorName;

    @TableField("PARENT_ID")
    @Schema(description = "父指标id")
    Long parentId;

    @TableField("SCORE")
    @Schema(description = "分数")
    String score;

    @TableField("YEAR")
    @Schema(description = "适用年份")
    String year;

    @TableField("SORT")
    @Schema(description = "排序")
    Integer sort;

    @TableField("TYPE")
    @Schema(description = "类型")
    String type;

    @TableField("REPORT_SOURCE_STYLE")
    @Schema(description = "数据来源方式(导入明细数据;分数;上报;数据抽取)")
    String reportSourceStyle;

    @TableField(exist = false)
    List<IndicatorTree> children;

    @TableField(exist = false)
    Boolean leaf;
    /**
     * 每一层级的科室及分数
     */
    @TableField(exist = false)
    List<DepartmentScore> departmentScores;
    /**
     * 详情查询规则
     */
    @TableField(exist = false)
    List<RulesTypeLevel> rulesTypeLevels;

    @TableField(exist = false)
    List<RulesTypeLevelGroup> groupList;

    @TableField(exist = false)
    private String selectPath;
    public void add(IndicatorTree indicatorTree) {
        children.add(indicatorTree);
    }
}
